
public class Hyip {
	
	public String name;
	public String firstPostBy;
	public String firstPostAt;
	
	public String createdDate;
	public String updatedDate;
	public String expireDate;
	public String dns;
	
	public Hyip(){
	}
	
	public Hyip(String name, String firstPostBy, String firstPostAt){
		this.name = name;
		this.firstPostAt = firstPostAt;
		this.firstPostBy = firstPostBy;
	}
	
	public Boolean insertNameAndPost(){
		Boolean result = true;
		
		String query = String.format("INSERT INTO hyip(name, first_post_by, first_post_at) values ('%s', '%s', '%s')", this.name, this.firstPostBy, this.firstPostAt);
		System.out.println(query);
		
		Application.mysql.executeNoneQuery(query);
		
		return result;
	}
	
	public Boolean updateHostInfo(){
		Boolean result = true;
		
		String query = String.format("UPDATE hyip set created_date='%s', updated_date='%s', expire_date='%s', dns='%s' where name='%s'", this.createdDate, this.updatedDate, this.expireDate, this.dns, this.name);
		System.out.println(query);
		
		Application.mysql.executeNoneQuery(query);
		
		return result;
	}
	
}
